<?php
/**
 * 后台入口程序 - JBlog
 * 
 * @copyright (c) 2008-2010 JBlog (www.lisijie.org)
 * @author lisijie <lisijie86@gmail.com>
 * @version $Id: admin.php 524 2010-06-23 14:16:28Z lisijie86 $
*/

define('IN_ADMIN',True);
define('ADMIN_DIR', 'admin'); //后台目录
require 'include/common.php';
define('ADMIN_ROOT', JBLOG_ROOT.ADMIN_DIR.DS);
require_once ADMIN_ROOT.'func_admin.php';
require_once JBLOG_INC.'func_cache.php';

initGP(array('mod', 'ac', 'do'));

if ( empty($mod) || !preg_match('/^[a-z_]+$/i', $mod) ) {
	$mod = 'index';
}

$javascript = array();

if ( !$_USER['id'] ) redirect('user.php?ac=login');

//加载JS
load_js(array('script/jquery.js', 'script/common.js', 'script/admin.js'));

define('BASE_URL', "admin.php?mod={$mod}&ac={$ac}");
if ( file_exists(ADMIN_ROOT."mod_{$mod}.php") ) {
	require ADMIN_ROOT."mod_{$mod}.php";
}
?>